#ifndef PROJECT_H
#define PROJECT_H

#include <QAbstractItemModel>
#include <QMap>
#include <QDir>
#include <QXmlStreamWriter>
#include "LanguageModel.h"

class Project : public QObject
{
public :
    Project();
    ~Project();

    void addLanguage( QString language_name, LanguageModel * model );

    void save( const QString & base_filename );
    bool load( QFile & file );

    void setProjectName( const QString & project_name )
    {
        ProjectName = project_name;
    }

    const QString & getProjectName( void ) const
    {
        return ProjectName;
    }

    bool hasName( void )
    {
        return ProjectName.length() > 0;
    }

    QMap<QString, LanguageModel *> * getLanguageModelMap()
    {
        return language_map;
    }

private :

    Project( const Project & other );
    Project & operator=( const Project & other );

    void handleElement();

    QMap<QString, LanguageModel *> * language_map;
    QString ProjectName;
    QString projectDir;
    QXmlStreamReader * streamReader;
};

#endif //PROJECT_H